home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <time.h>
-
- #include "Search.h"
-
- // -----------------------------
- // writes AmigaGuide file header
- // -----------------------------
- void write_header(void) {
- char stuff[1000]="";
-
- struct tm *tp;
- time_t timestamp=0; // time stuff
-
- // ------------------------
- // BuffyResults file header
- // write out to new file
- // ------------------------
-
- fputs("@database \"BuffyResults.guide\"\n",temp_fp);
- fputs("@font XHelvetica.font 11\n",temp_fp);
- fputs("@author \"BuffyGuideSearch v1.0\"\n",temp_fp);
- fputs("@wordwrap\n",temp_fp);
- fputs("@node MAIN \"Buffy Search Results\"\n",temp_fp);
- fputs("\n",temp_fp);
-
- // title
- fputs("@{b}Buffy Search Results@{ub}\n",temp_fp);
- fputs("\n",temp_fp);
-
- // calc buffer
- timestamp = time(NULL);
- tp = localtime(×tamp);
- sprintf(stuff,"Peformed on: %s\n",asctime(tp));
-
- // put fancy time of search
- fputs(stuff,temp_fp);
- fputs("\n",temp_fp);
-
- // string
- sprintf(stuff,"Search string given was: %s\n",searchstring);
- fputs(stuff,temp_fp);
- fputs("\n",temp_fp);
-
- } // end write_header
-
-
- // --------------
- // writes endnode
- // --------------
- void write_end(void) {
- char stuff[1000]="";
-
- // write number of matches
- sprintf(stuff,"\nNo. of matches found: %d\n",matchesfound);
- fputs(stuff,temp_fp);
-
- // write info sofar to search file
- sprintf(stuff,"\nSearched %d lines and %d nodes, in %g secs\n", lines, nodes, (total / 60));
- fputs(stuff,temp_fp);
-
- // End main node in results guide
- fputs("\n@{I}Generated By the BuffyGuideSearch V1.0.2\n",temp_fp);
- fputs("© Matthew J Fletcher - 2000@{ui}\n",temp_fp);
- fputs("@endnode\n",temp_fp);
-
- } // end write_end
-
-
-